import ContextTodo ,{state} from '../../../../src/store/contextTodo' 
import {useState} from 'react'
import ContextChild1 from './ContextChild1'
import ContextChild2 from './ContextChild2'
const ContextParent=()=>{
  const [todo, setTodo ] = useState(state)
    const updateList = (item) => {
      let objTodo = {...todo }
      objTodo.todoList.push(item)
      setTodo(objTodo)
    }
    return (
      <div>
        <ContextTodo.Provider value={{...todo, updateList}}>
          <ContextChild1/>
          <ContextChild2/>
        </ContextTodo.Provider>
      </div>
    )
}
export default ContextParent